<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>测试</title>
	<script>

	window.onload = function(){
	var ali = document.getElementsByTagName('li');

	// alert(ali.length);
//获取标签
	for(var i =0;i<ali.length;i++){
		
		ali[i].style.backgroundColor = 'yellow';
		
		}
	
	}


	var oul = document.getElementById('list1')
	





	</script>
</head>
<body>
	<div>这是个div标签</div>
	<ul id="list">
		<li>1</li>
		<li>2</li>
		<li>3</li>
		<li>4</li>
		<li>5</li>
	</ul>


	<ul id ="list2">
		<li>6</li>
		<li>7</li>
		<li>8</li>
		<li>9</li>
		<li>10</li>
	</ul>


</body>
</html>